package com.sky.mapper;

import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    @Select("select * from employee where id = #{id}")
    Employee getById(Long id);

    /**
     * 修改员工密码
     * @param empId
     * @param newPassword
     */
    void updatePassword(Long empId, String newPassword);

    /**
     * 获取员工列表
     * @param name
     */
    List<Employee> getEmpList(String name);

    /**
     * 新增员工
     * @param employee
     */
    void save(Employee employee);

    /**
     * 修改员工信息
     * @param employee
     */
    void update(Employee employee);

    /**
     * 修改员工状态
     * @param employee
     */
    void serStatus(Employee employee);
}
